package com.service.gmall.Item.test;

import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author alpha
 * @className: HomeController
 * @Description
 */
/*测试502*/
@RestController
public class HomeController {
    @RequestMapping(value = "/home")
    public String home(HttpServletRequest request, HttpServletResponse response) {
        String headCount = request.getParameter("headCount");
        if (!StringUtils.hasText(headCount)) {
            headCount = "300";
        }
        for (int i = 0; i < Integer.parseInt(headCount); i++) {
            response.setHeader(String.valueOf(i), String.valueOf(i));
        }
        return "success";
    }
}
